package xian.woniuxy.d_String_StringBuilder_StringBuffer;

public class Foo {
    private int id = 0;

    public Foo(int id) {
        this.id = id;
    }

    public Foo incrId() {
        return new Foo(id + 1);
    }

    @Override
    public String toString() {
        return "Foo{" +
                "id=" + id +
                '}';
    }
}
